package jjn.acwing.java_basic;

import java.util.Scanner;

/**
 * @author Jjn
 * @since 2023/8/19 14:09
 */
public class Acwing661 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        double n1 = scanner.nextDouble();
        double n2 = scanner.nextDouble();
        double n3 = scanner.nextDouble();
        double n4 = scanner.nextDouble();
        double mean = (2 * n1 + 3 * n2 + 4 * n3 + n4) / 10;
        System.out.printf("Media: %.1f\n", mean);
        if (mean >= 7.0) {
            System.out.println("Aluno aprovado.");
        } else if (mean < 5.0) {
            System.out.println("Aluno reprovado.");
        } else {
            System.out.println("Aluno em exame.");
            double y = scanner.nextDouble();
            double z = (mean + y) / 2;
            System.out.printf("Nota do exame: %.1f\n", y);
            if (z >= 5.0) {
                System.out.println("Aluno aprovado.");
            } else {
                System.out.println("Aluno reprovado.");
            }
            System.out.printf("Media final: %.1f\n", z);
        }
    }
}
